import xadmin
from .models import UserAsk
from .models import CourseComments
from .models import UserFavorite
from .models import UserMessage
from .models import UserCourse


class UserAskAdmin(object):
    list_display = ['name', 'mobile', 'course_name', 'createUser', 'create_time', 'deleted']
    search_fields = ['name', 'mobile', 'course_name', 'createUser']
    list_filter = ['name', 'mobile', 'course_name', 'createUser', 'create_time', 'deleted']


class CourseCommentsAdmin(object):
    list_display = ['userId', 'courseId', 'comments', 'createUser', 'create_time', 'deleted']
    search_fields = ['userId', 'courseId', 'comments', 'createUser']
    list_filter = ['userId', 'courseId', 'comments', 'createUser', 'create_time', 'deleted']


class UserFavoriteAdmin(object):
    list_display = ['userId', 'fav_id', 'fav_type', 'createUser', 'create_time', 'deleted']
    search_fields = ['userId', 'fav_id', 'fav_type', 'createUser']
    list_filter = ['userId', 'fav_id', 'fav_type', 'createUser', 'create_time', 'deleted']


class UserMessageAdmin(object):
    list_display = ['user', 'message', 'has_read', 'createUser', 'create_time', 'deleted']
    search_fields = ['user', 'message', 'has_read', 'createUser']
    list_filter = ['user', 'message', 'has_read', 'createUser', 'create_time', 'deleted']


class UserCourseAdmin(object):
    list_display = ['userId', 'courseId', 'createUser', 'create_time', 'deleted']
    search_fields = ['userId', 'courseId', 'createUser']
    list_filter = ['userId', 'courseId', 'createUser', 'create_time', 'deleted']


xadmin.site.register(UserAsk, UserAskAdmin)
xadmin.site.register(CourseComments, CourseCommentsAdmin)
xadmin.site.register(UserFavorite, UserFavoriteAdmin)
xadmin.site.register(UserMessage, UserMessageAdmin)
xadmin.site.register(UserCourse, UserCourseAdmin)
